//
//  DicRequest.m
//  MBObjectServer
//
//  Created by Juvid on 14-3-5.
//  Copyright (c) 2014年 MBpayer. All rights reserved.
//

#import "DicRequest.h"
//#import "definehead.h"
@implementation DicRequest




+ (BOOL)isPureInt:(NSString*)string{
    NSScanner* scan = [NSScanner scannerWithString:string];
    int val;
    return[scan scanInt:&val] && [scan isAtEnd];
}

+ (BOOL)isPureFloat:(NSString *)string{
    NSScanner* scan = [NSScanner scannerWithString:string];
    float val;
    return [scan scanFloat:&val] && [scan isAtEnd];
}  

+(void)ShowAlert:(NSString *)title Message:(NSString *)message{
    UIAlertView * alertview = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
    [alertview show];
}
//
+(NSString *)GetUserID{
//     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
//    [userDefaults objectForKey:@"UserID"];
    return [[NSUserDefaults standardUserDefaults] objectForKey:kUserID];
}
+(NSString *)GetOrgCode
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:kOrgCode];
    
}
+(NSString *)GetShopName
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:kShopName];

}

+(NSString *)GetUserName{
    return [[NSUserDefaults standardUserDefaults] objectForKey:kUserName];
    
}
+(NSString *)GetShopID{
    return [[NSUserDefaults standardUserDefaults] objectForKey:kShopID];
}
+(NSString *)GetVIPCode{
    return [[NSUserDefaults standardUserDefaults] objectForKey:kVIPCode];
}



//库存查询
+(MBBaseServer *)GetStocks:(NSString *)ProdID
{
    MBBaseServer  *baseserver = [[MBBaseServer alloc]init];
    baseserver.isStartLoad=YES;
    NSMutableDictionary* postDic=[[NSMutableDictionary alloc]init];
    [postDic setObject:@"A01339S011" forKey:@"OrgCode"];
    [postDic setObject:ProdID forKey:@"ProdID"];
    [baseserver setRequestStyle:nil andSetPathString:@"stock_handler.ashx" andSetHeadString:ProdID andActionName:@"GetStockJson" andSetMainDictionary:postDic];
    return baseserver;
}
@end
